the get() command for AccessRec's is in the manual as: AccessRec get({Object o|Module m|Project p|Folder f|Item i|View v}, [AttrType at,] string user, string &message) However, I keep getting the following error when attemting to get the AccessRec of specific AttrType(s) when I include the optional AttrType: "<Line:12> null AccessRec parameter was passed into argument position 1" I'm basically understanding this to mean that the get() command is returning a null access record. But if I open the attribute types list from the menu bar (i.e. Edit > Types...) and open individual types, they all show access permissions (some are inherited, some are not). If I include a if(!null ar) statement to avoid null access records I simply get no output... but I want to get the access rights to each type. I'm not sure what I'm missing, any help is appreciated. here's how my code works...
AttrType at
Module m = current Module
AccessRec ar
string msg
for at in m do
{
for ar in at do
{
ar = get(m,at,doorsname,msg)
if (read ar) print "read"
if (modify ar) print "modify"
if (create ar) print "create"
if (delete ar) print "delete"
if (control ar) print "control"
print "\n"
}
}
developerTom - Wed Mar 19 09:52:44 EDT 2014 |
Re: AccessRec of specific AttrType I think you are confusing an "AccessRecord" with the notion of "Permission". Line 10: You will get a null "ar" unless there is an actual AccessRecord for the current user specifically. So if the single record is"everyoneElse" has "RMCDA", then the current user (doorsname) does NOT have an AccessRecord. I think you want to investigate "hasPermision" commands. Line 8 and 10 do not combine; where line 10 changes the loop control handle in line 8. You can either loop (line 8) and print the current AccessRecords, OR try to find Permission for the current user. Be advised that the
-Louie |